package com.authine.cloudpivot.ext.dto.model.contract;

import com.authine.mvp.app.launcher.domain.SelectorFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 代购服务费模板表(service_fee_template)模型类
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ContractServiceFeeTemplate implements Serializable {

    private static final long serialVersionUID = -98134828356049885L;



    private String id;
    /**
     * 组织ID
     */
    @Schema(description = "组织ID 不能为空")
    private SelectorFormat organization_id;
    /**
     * 组织名称
     */
    @Schema(description = "组织名称 不能为空")
    private String organization_name;
    /**
     * 起始天数
     */
    @Schema(description = "起始天数 不能为空")
    @Min(value = 0, message = "起始天数必须大于等于0")
    private BigDecimal start_day;
    /**
     * 增量天数
     */
    @Min(value = 0, message = "增量天数必须大于等于0")
    @Schema(description = "增量天数")
    private BigDecimal increment_day;
    /**
     * 缓冲天数
     */
    @Schema(description = "缓冲天数 不能为空")
    @Min(value = 0, message = "起始天数必须大于等于0")
    private BigDecimal buffer_day;
    /**
     * 年比例
     */
    @Schema(description = "年比例 不能为空")
    private BigDecimal annualized_ratio;

    @NotEmpty(message = "公式 不能为空")
    @Schema(description = "公式")
    private String formula;
    /**
     * 其它比例
     */
    @Schema(description = "其他比例")
    private BigDecimal other_ratio;




    private BigDecimal amount;
    private BigDecimal days;

    public BigDecimal getYear_days() {
        return new BigDecimal(365);
    }

}
